'use strict';

/*
 * @Descripttion: 
 * @Author: ziwei
 * @Date: 2022-08-14 11:56:09
 * @LastEditors: ziwei
 * @LastEditTime: 2022-08-14 11:57:40
 */

//原型链继承
function Parent() {
    this.name = 'kevin';
}
Parent.prototype.getName = function () {
    console.log(this.name);
};
function Child() {}

console.log(new Parent());
Child.prototype = new Parent();
var child1 = new Child();
console.log(child1.getName()); // kevin